home *** CD-ROM | disk | FTP | other *** search
- Echo off
- cls
- :BEGIN
- :The previous line is used as a GOTO label, this line is a comment.
- :This batch file was INTENTIONALLY made too long for teaching purposes.
- echo ------------------------------------------------------------------------
- echo FOUNDATION ARTICLE LECTURE ON DISK
- echo Tony Lindsey, (619) 295-2922 3752 Third Avenue, San Diego CA 92103
- echo ------------------------------------------------------------------------
- echo Choose one of the below:
- echo 1. To page through the INTRODUCTION on your screen.
- echo 2. To page through the FOUNDATION article on your screen.
- echo 3. To print out the FOUNDATION article on CONTINUOUS,
- echo PERFORATED PAPER (about 30 pages worth). If you
- echo know how to print out something from DOS
- echo with pauses between single, cut sheets
- echo of paper, PLEASE let me know!
- echo
- echo ESC key. EXIT MENU AND RETURN TO DOS
- echo ------------------------------------------------------------------------
- :The next few lines mean that the INPUT command will ONLY accept what
- :characters are in between the quotes (upper or lower case doesn't matter),
- :and allows the batch file to branch accordingly by setting the ERRORLEVEL.
- INPUT "123"
- :Please notice that the following lines MUST
- :have errorlevels in descending order, and the Esc key has a value of 255.
- IF ERRORLEVEL 255 GOTO END
- IF ERRORLEVEL 3 goto CHOICE3
- IF ERRORLEVEL 2 goto CHOICE2
- IF ERRORLEVEL 1 goto CHOICE1
- GOTO BEGIN
- :CHOICE1
- :The next line displays INTRO.DOC with the LIST command.
- LIST INTRO.TXT
- goto more?
- :CHOICE2
- LIST FNDATION.TXT
- goto more?
- :CHOICE3
- :The next few lines show how the PRNCHECK command detects whether the
- :printer is "on-line", and and branches the batch file accordingly.
- :The "if not errorlevel 1 etc." is the ONLY way I can get it to work!
- prncheck
- if not errorlevel 1 goto NEXT
- cls
- echo The printer is NOT ready! We need to send a file to the printer,
- echo and it won't work unless all systems are GO.
- echo Please get the printer ready, and we'll try it again...
- pause
- goto BEGIN
- :next
- :The next line prints out the FNDATION.TXT file.
- type FNDATION.TXT >PRN
- :MORE?
- cls
- :The next lines show how the QUERY command detects a "?" and asks (Y or N),
- :and then sets a TRUE or FALSE errorlevel.
- Echo Would you like to go back to the main menu?
- query
- cls
- if errorlevel 1 goto begin
- :END
- cls
-